<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        function asyncTask1() {
                return new Promise((resolve) => {
                    setTimeout(() => {
                        resolve('任务 1 完成');
                    }, 1000);
                });
            }

            function asyncTask2(result) {
                return new Promise((resolve) => {
                    setTimeout(() => {
                        resolve(`${result}，接着任务 2 完成`);
                    }, 1000);
                });
            }

            function asyncTask3(result) {
                return new Promise((resolve) => {
                    setTimeout(() => {
                        resolve(`${result}，随后任务 3 完成`);
                    }, 1000);
                });
            }

            asyncTask1()
                .then(asyncTask2)
                .then(asyncTask3)
                .then((finalResult) => {
                    console.log(finalResult);
                })
                .catch((error) => {
                    console.error(error);
                });
    </script>
</body>
</html>